//
//  DynamicViewModel.m
//  DynamicTableViewTest
//
//  Created by Tiant on 2020/7/14.
//  Copyright © 2020 YYL. All rights reserved.
//

#import "DynamicViewModel.h"

@implementation DynamicViewRowModel

@end

@implementation DynamicViewSectionModel

- (NSMutableArray<DynamicViewRowModel *> *)rows {
    if (!_rows) {
        _rows = [NSMutableArray array];
    }
    return _rows;
}

@end

@implementation DynamicViewModel

- (NSMutableArray<DynamicViewSectionModel *> *)sections {
    if (!_sections) {
        _sections = [NSMutableArray array];
    }
    return _sections;
}

- (void)setType:(NSInteger)type {
    _type = type;
    
    if (type == 0) {
        ///样式一
        DynamicViewSectionModel *section_0 = [DynamicViewSectionModel new];
        section_0.isHasSectionFooter = YES;
        section_0.sectionFooterViewHeight = 20;
        section_0.sectionFooterView = [UIView new];
        
        DynamicViewRowModel *row_0 = [DynamicViewRowModel new];
        row_0.cellClassName = @"YYTableViewCell_1";
        [section_0.rows addObject:row_0];
        
        DynamicViewRowModel *row_1 = [DynamicViewRowModel new];
        row_1.cellClassName = @"YYTableViewCell_2";
        [section_0.rows addObject:row_1];
        
        DynamicViewRowModel *row_2 = [DynamicViewRowModel new];
        row_2.cellClassName = @"YYTableViewCell_0";
        [section_0.rows addObject:row_2];
        
        DynamicViewRowModel *row_3 = [DynamicViewRowModel new];
        row_3.cellClassName = @"YYTableViewCell_3";
        [section_0.rows addObject:row_3];
        
        [self.sections addObject:section_0];
        
        
        DynamicViewSectionModel *section_1 = [DynamicViewSectionModel new];
        section_1.isHasSectionFooter = YES;
        section_1.sectionFooterViewHeight = 40;
        section_1.sectionFooterView = [UIView new];
        
        DynamicViewRowModel *row_1_0 = [DynamicViewRowModel new];
        row_1_0.cellClassName = @"YYTableViewCell_1";
        [section_1.rows addObject:row_1_0];
        
        DynamicViewRowModel *row_1_1 = [DynamicViewRowModel new];
        row_1_1.cellClassName = @"YYTableViewCell_2";
        [section_1.rows addObject:row_1_1];
        
        [self.sections addObject:section_1];
        
    }
    else if (type == 1) {
        
    }
    else if (type == 2) {
        
    }
    else {
        
    }
}

@end
